<?php
class Pageley_Serializer_Converter_Reference extends Pageley_Serializer_Converter_Default {

    public function convertIntoFormat($value) {
        return $value != null ?
        	(is_numeric($value) ? $value : $value->getId())
        	: null;
    }
}